<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
    <head>
        <title>SecureMail: Spring Security</title>
        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="icon" type="image/x-icon" href="/assets/img/favicon.ico" th:href="@{/assets/img/favicon.ico}"/>
        <link rel="stylesheet" href="/webjars/bootstrap/css/bootstrap.css" th:href="@{/webjars/bootstrap/css/bootstrap.css}" />
        <link rel="stylesheet" href="/assets/css/custom.css" th:href="@{/assets/css/custom.css}"/>
    </head>
    <body>
        <div th:replace="templates::header"></div>
        <div class="container">
            <h1>Compose</h1>
            <br />
            <form class="form-horizontal form-message-compose" action="#" th:action="@{/messages}" th:method="post">
                <div class="form-group">
                    <label for="toUser" class="col-sm-1 control-label">To:</label>
                    <div class="col-sm-3">
                        <select class="form-control" name="toUser" id="toUser" th:field="${message.toId}">
                            <option value="">---Please select---</option>
                            <option th:each="user : ${users}" th:value="${user.userId}" th:text="${user.firstName} + ' ' + ${user.lastName}"></option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="subject" class="col-sm-1 control-label">Subject:</label>
                    <div class="col-sm-5">
                        <input type="text" class="form-control" id="subject" name="subject" th:field="${message.summary}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="message" class="col-sm-1 control-label">Message:</label>
                    <div class="col-sm-7">
                        <textarea rows="3" class="form-control" id="message" name="message" th:field="${message.text}"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-3">
                        <button type="submit" class="btn btn-primary">Send</button>
                    </div>
                </div>
            </form>
        </div>
        <div th:replace="templates::footer"></div>
        <script src="/webjars/jquery/jquery.min.js" th:src="@{/webjars/jquery/jquery.min.js}"></script>
        <script src="/webjars/bootstrap/js/bootstrap.min.js" th:src="@{/webjars/bootstrap/js/bootstrap.min.js}"></script>
    </body>
</html>
